perm filename READ.TEX[WEB,ALS]1 blob sn#638418 filedate 1982-01-28 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	\input kermac 
C00011 ENDMK
CāŠ—;
\input kermac 
\input papmac
    \def\TEX{\hbox{T\hskip-.125em\lower.5ex\hbox{E}\hskip-.075em X}}
    \def\;{\char'040}
\ninepoint
\fullpages
\baselineskip 10pt
\ctrline{This is a \TEX\ tape from Stanford University.}

This tape is written in ASCII, 1600 BPI, LRECL 80, BLKSIZE 8000.  The
information that it contains is in the public domain and may be reproduced
freely and distributed to others.  While we have made every effort to make
the tape free of error, we cannot guarantee its accuracy.

We would have liked to have sent you an exact duplicate of a number of
files that exist on our disk, but incompatabilities between tape handeling
and files systems make this impossible.  Rather, each ``tape file''
represents one of our ``disk files.''  We hope that the representations we
have chosen will allow you to construct disk files of your own that
accuratly replicate ours.  This document explains the tape file
representations.

All of the blocks on this tape contain 8000 ASCII characters.  Each block
is considered to be 100 lines of 80 characters each. The lines are padded
with spaces and the blocks are padded with empty lines (i.e. lines of 80
spaces) as required.  None of the disk files we are sending has any lines
that are more than 80 characters long, so there is no problem with lines
getting split or truncated in the tape file and none has any lines with
significant trailing spaces.  (Currently, only {\tt *.STR} files violate
this restriction.  This problem will be remedied in \TEX 82, but for now
the STR files need special attention.)  As you read a tape file, you may
remove the trailing spaces at the end of each line, and the trailing blank
lines, if your computer is happy with this.

The files may be in two different formats.  Each separate file is followed
by a tape mark and the last file on the tape is followed by an extra tape
mark.  Each tape file corresponds to one disk file.  The first line of
each tape file is an ID line that is not part of the disk file.  Rather,
it tells the name of the corrosponding disk file, and tells which of two
possible representations the tape file is in.

The first representation is Text Format.  A typical ID line for a text file
looks like:\lbrk
{\rraggedd \tt \1
This is `TEX.PAS' in text format as of Jan. 28, 1982.}

This means that the rest of that tape file is the (old) Pascal version of
\TEX.  As noted above, all trailing spaces in each line and all trailing
blank lines may be removed.

The ID line for a file containing binary information would say something like:\lbrk
{\rraggedd \tt \1
This is `CMR10.TFM' in decimal-byte-expansion format as of Jan. 28, 1982.}

In decimal-byte-expansion format, each byte of the disk file is represented by
exactly four  ASCII characters on the tape file.  These characters are all in
the set (` ',`0',`1',...,`9').  The four characters that represent a byte are
the decimal representation of the byte.  Thus, the only combinations you'll be
seeing are\linebreak
{\tt `{\; \; \; }0',`{\; \; \;}1',...,`{\; \; \;}9',`{\; \;}10',...,`{\;
}254', and `{\;}255'} 
(where \ {\tt \;}\ \  stands for a space).  The last byte's representation is followed by
{\tt ` \ -1'} as an end of file indicator
(the {\tt ` \ -1'} is not a part of the disk file).  Since 80 is evenly divisible
by four, there will be no problems with numbers getting split across the
80 character lines. You will find that all the binary disk files we send are
always a multiple of 4 bytes long, so the decimal-byte-expanded tape files
will always be a multiple of 16 characters long, not counting the {\tt ` \ -1'} and
any padding following it. For example, a binary disk file that is twelve
bytes long might look like this on the tape:\lbrk
{\rraggedd \tt \1
This is file `FOO.BAR' in decimal-byte-expansion format as of Feb. 29, 1984.
Doing <TEX.FONTS>CMATHX.TFM.6
\ 223 223 \ \ 1 \ \ 2 \ 99 199 \ \ 9 \ 10 123 255 \ 21 \ \ 0 \ -1}

The following Pascal program converts a Decimal-Byte-Expanded tape
file back to a binary disk file exactly as it existed here at Stanford:

\noindent {\rraggedd\1
program undbe; $\{$Pack a `Decimal-Byte-Expansion' file back into a file of bytes$\}$
var
  dbefile: text;
  bytefile: packed file of 0..255;
  b: integer;
begin
reset(dbefile);
rewrite(bytefile);
readln(dbefile); $\{$Skip the identification line$\}$
read(dbefile,b); $\{$Get the first byte into b$\}$
while b>$-$1 do begin
  write(bytefile,b);
  read(dbefile,b);
  end;
end.}

\vfill

\noindent Stanford University\lbrk
January 25, 1982\lbrk
drf,als

\end